//
// Created by ms on 2025/10/21.
//

#ifndef _LOWPASSFILTER_H
#define _LOWPASSFILTER_H


/**
 * define the "get timestamp" function before use.
 */
#ifndef get_micros
#define get_micros()	0
#endif

class LowpassFilter {
public:
	explicit LowpassFilter(float Tf) :
		_Tf(Tf) {
		last_output    = 0;
		last_timestamp = 0;
	}

	float operator()(float input);

public:
	float _Tf;

private:
	float         last_output;
	unsigned long last_timestamp;
};


#endif //_LOWPASSFILTER_H
